package com.zhu.transaction.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author zhu
 * @since 2021-01-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "TOrder对象", description = "")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    private String id;

    @ApiModelProperty(value = "订单号")
    private String orderId;

    @ApiModelProperty(value = "发布用户ID")
    private String releaseUser;

    private User releaseUserPojo;

    @ApiModelProperty(value = "购买用户名")
    private String purchaseUserName;

    @ApiModelProperty(value = "购买用户联系电话")
    private String purchaserPhone;

    @ApiModelProperty(value = "购买用户地址")
    private String address;

    @ApiModelProperty(value = "商品ID")
    private String productId;

    @ApiModelProperty(value = "商品名")
    private String productName;

    @ApiModelProperty(value = "商品图片")
    private String productImg;

    @ApiModelProperty(value = "支付状态", example = "1")
    private Integer paymentState;

    @ApiModelProperty(value = "交易状态", example = "1")
    private Integer transactionState;

    @ApiModelProperty(value = "购买时间")
    private Date purchaseTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "购买价格", example = "1")
    private Float price;

    @ApiModelProperty(value = "购买用户")
    private String purchaseUser;

    @ApiModelProperty(value = "支付方式")
    private Integer purchaseWay;

    @ApiModelProperty(value = "微信支付结果")
    private String qrcodeResult;

    @ApiModelProperty(value = "微信支付的二维码接口")
    private String qrcodeUrl;

    @ApiModelProperty(value = "支付宝支付的接口")
    private String alipayUrl;

    public String getStringPurchaseTime() {
        return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(this.purchaseTime);
    }

}
